<template>
  <page-body>
    <view class="page">
      <view class="flex benben-position-layout flex flex-wrap align-center Mycourse_flex_0"
        :style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx', }">
        <view class='flex flex-wrap align-center justify-between flex-sub Mycourse_fd0_0'>
          <view class='flex flex-wrap align-center Mycourse_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
            data-url="1">
            <text class='fu-iconfont2  Mycourse_fd0_0_c0_c0'>&#xE794;</text>
          </view>
          <view class='flex flex-wrap align-stretch justify-center'>
            <text class='Mycourse_fd0_0_c1_c0'>我的课程</text>
          </view>
          <view class='flex flex-wrap align-center justify-end Mycourse_fd0_0_c0'>
          </view>
        </view>

      </view>
      <view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
      <!---flex布局flex布局开始-->
      <view class="flex benben-flex-layout flex-wrap align-center" style="position: fixed;top: 138rpx;left: 0;background-color: #f6f6f6;z-index: 10000;">
        <view>
          <benben-flex-tabs class-name='Mycourse_benbenTabsfd1_0' v-model="tabLab" ref="benben_tabsfd1_0"
            select-mark="benben_tabsfd1_0" key="benben_tabsfd1_0" :open-title-type='false' :open-sticky='false' :top='0'
            :is-show-content='false' :scrollspy='false' :tabs-info.sync="tabsInfofd1_0" @change="tabChangeFunc()">

            <scroll-view @scroll="tabsInfofd1_0.scrollX = $event.detail.scrollLeft" id="benben_tabsfd1_0"
              class="benben-tabs" style="width:750rpx" :scroll-x="false" :scroll-left="tabsInfofd1_0.moveX"
              scroll-with-animation="all .3s ease">
              <view class="benben-tabs-content" id="benben_tabsfd1_0-content">
                <view id="benben_tabsfd1_0-title" class="benben-tabs-title flex flex align-center justify-around">
                  <template v-for='(item,key0) in tabs'>
                    <view :key='key0'
                      :class="{ 'checkTitlefd1_0': tabLab == item.value, 'flex flex-wrap align-center': true }"
                      @tap="tabLab = item.value" :id="`benben_tabsfd1_0-title-item-${item.value}`">

                      <text>{{item.name}}</text>

                    </view>
                  </template>
                </view>
                <view :style="{ left: tabsInfofd1_0.lineleft, maxWidth: tabsInfofd1_0.lineWidth ,}"
                  id="benben_tabsfd1_0-line" class="benben-tabs-line flex benben-flex-tabs-line Mycourse_linefd1_0">
                </view>
              </view>
            </scroll-view>

          </benben-flex-tabs>

        </view>
      </view>

      <!---flex布局flex布局结束-->
      <!---flex布局flex布局开始-->
      <!-- <scroll-view :scroll-y="true" :show-scrollbar='true' :refresher-enabled='true' @refresherrefresh="getAjax"
        :refresher-triggered="isShow"> -->
      <view class="flex flex-wrap align-center justify-between benben-flex-layout Mycourse_flex_2">
        <template v-for='(item,key0) in list'>
          <view class='flex flex-direction flex-wrap align-stretch Mycourse_fd2_0' @tap.stop="handleJumpDiy"
            data-type="navigateTo" :data-url="`/pages/honoDeta/courseIns/courseIns?course_id=${item.course_id}&navType=2`" :key='key0'>
            <image class='Mycourse_fd2_0_c0' mode="aspectFill" :src='item.course_thumb'></image>
            <text class='Mycourse_fd2_0_c1' v-if=" item.is_study=='1'">必修</text>
            <view class='flex flex-direction flex-wrap align-stretch Mycourse_fd2_0_c2'>
              <text class='Mycourse_fd2_0_c2_c0'>{{item.course_name}}</text>
              <view class='flex flex-wrap align-center Mycourse_fd2_0_c2_c1'>
                <text>共</text>
                <text>{{item.zj_num}}</text>
                <text>章节</text>
              </view>
            </view>
          </view>
        </template>
        <fu-empty :pagingListLoadedAll="pagingListLoadedAll" :pagingListNoListData="pagingListNoListData"
          :listDataLength="listDataLength" :isLoadInit="isLoadInit"></fu-empty>
      </view>
       <!-- </scroll-view> -->
      <!---flex布局flex布局结束-->


    </view>
  </page-body>
</template>
<script>
  import pagingList from '@/common/mixin/paging_list.js';
  import {
    validate
  } from '@/common/utils/validate.js'

  export default {
    components: {},
    mixins: [pagingList],

    data() {
      return {
        "tabsInfofd1_0": {
          lineleft: '',
          lineWidth: '',
          moveX: 0,
          scrollX: 0,
          PageScrollX: 0
        },
        "minixPagingListsApi": "",
        "pageingListApiMethod": "",
        "allowOnloadGetList": false,
        "tabs": [{
          "name": "未开始",
          "value": "0",
          "image": ""
        }, {
          "name": "正在学习",
          "value": "1",
          "image": ""
        }, {
          "name": "已完成",
          "value": "2",
          "image": ""
        }, {
          "name": "超时未学习",
          "value": "3",
          "image": ""
        }],
        "tabLab": "0",
        "list": [],
        isShow: false,
      };
    },
    computed: {

    },
    watch: {},
    onLoad(options) {

    },
    onUnload() {

    },
    onReady() {

    },
    onShow() {
      this.getet481b4e7acb50Func()
    },
    onHide() {

    },
    onResize() {

    },
    onPullDownRefresh() {
    this.getet481b4e7acb50Func()
    },
    onReachBottom(e) {

    },
    onPageScroll(e) {

    },
    methods: {
      getAjax() {
        var that = this;
        if (!that.isShow) {
          that.isShow = true;
          //下拉加载，先让其变true再变false才能关闭
          //关闭加载状态 ，需要一点延时才能关闭
          // this.get_banner_listFunc()
          // this.getmk6bda39629cbfFunc()
          this.getet481b4e7acb50Func()
          setTimeout(() => {
            that.isShow = false;
          }, 200)
        }
      },
      //查询学习课程列表
      getet481b4e7acb50Func() {
        this.minixPagingListsApi = global.apiUrls.post6481b4e7acb50;
        this.pageingListApiMethod = 'get';
        this.allowOnloadGetList = false;
        this.pagingListPostDataContent = {
          type: this.tabLab
        }
        this.listData = [];
        this.list = this.listData;
        this.pagingListToggle();

      },
      //tabs改变
      tabChangeFunc() {
        this.getet481b4e7acb50Func()
      },
      pagingListPostData() {
        return this.pagingListPostDataContent
      }
    }
  };
</script>
<style lang="scss" scoped>
  .page {
    width: 100vw;
    overflow-x: hidden;
    min-height: calc(100vh - var(--window-bottom));
    background: #F6F6F6;
    background-size: 100% auto;
    position: relative;
  }

  .Mycourse_flex_0 {
    background: #fff;
    width: 750rpx;
    height: 88rpx;
    overflow: hidden;
    z-index: 10;
    top: 0rpx;
    background-size: 100% auto !important;
  }

  .Mycourse_fd0_0_c1_c0 {
    font-size: 36rpx;
    font-weight: 700;
    color: #333333;
    line-height: 50rpx;
  }

  .Mycourse_fd0_0_c0_c0 {
    font-size: 36rpx;
    color: #333;
  }

  .Mycourse_fd0_0_c0 {
    width: 120rpx;
  }

  .Mycourse_fd0_0 {
    padding: 0rpx 32rpx 0rpx 32rpx;
  }

  .Mycourse_linefd1_0 {
    background: #d53215;
    width: 30rpx;
    height: 8rpx;
    top: 80rpx;
    background-size: 100% auto !important;
    border-radius: 16rpx;
  }

  .checkTitlefd1_0 {
    font-weight: 700 !important;
    font-size: 28rpx !important;
    color: #333 !important;
  }

  ::v-deep .Mycourse_benbenTabsfd1_0 {
    background: #f6f6f6;
    width: 750rpx;
    height: 90rpx;
    white-space: nowrap;
    text-align: center;
  }

  .Mycourse_flex_2 {
    padding: 24rpx;
    margin-top: 88rpx;
  }

  .Mycourse_fd2_0_c2_c1 {
    font-size: 24rpx;
    line-height: 33rpx;
    font-weight: 400;
    color: rgba(153, 153, 153, 1);
  }

  .Mycourse_fd2_0_c2_c0 {
    font-size: 28rpx;
    font-weight: 500;
    line-height: 40rpx;
    margin: 0rpx 0rpx 16rpx 0rpx;
    width: 100%;
    -webkit-line-clamp: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
  }

  .Mycourse_fd2_0_c2 {
    padding: 16rpx 16rpx 07rpx 16rpx;
  }

  .Mycourse_fd2_0_c1 {
    background: linear-gradient(180deg, #FF6648 0%, #FF8C49 100%);
    position: absolute;
    background-size: 100% auto;
    width: 88rpx;
    line-height: 33rpx;
    text-align: center;
    color: var(--benbenFontColor3);
    font-size: 24rpx;
    font-weight: 500;
    border-radius: 16rpx 0rpx 16rpx 0rpx;
  }

  .Mycourse_fd2_0_c0 {
    width: 342rpx;
    height: 220rpx;
    border-radius: 16rpx 16rpx 0rpx 0rpx;
    margin: 0rpx 0rpx 0rpx 0rpx;
  }

  .Mycourse_fd2_0 {
    background: #fff;
    width: 342rpx;
    height: 342rpx;
    border-radius: 16rpx;
    background-size: 100% auto;
    margin: 0rpx 0rpx 16rpx 0rpx;
    position: relative;
  }
</style>
